package cn.crm.dao;

import cn.crm.pojo.CstCustomer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;

public interface CstCustomerDao extends BaseMapper<CstCustomer> {
    @Select("SELECT @rownum := @rownum + 1 AS rn,cust_level_label,COUNT(1) AS COUNT \n" +
            "FROM `cst_customer`,(SELECT @rownum := 0) r\n" +
            "WHERE cust_level_label IN(\n" +
            "SELECT cust_level_label FROM `cst_customer` \n" +
            ") GROUP BY cust_level_label ORDER BY rn;")
    List<CstCustomer> getCount();

}
